<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" id="i1">
<input type="text" id="i2">
<input type="button" value="加" onclick="mufn(1)">
<input type="button" value="减" onclick="mufn(2)">
<input type="button" value="乘" onclick="myfn(3)">
<input type="button" value="除" onclick="myfn(4)">
<div id="dd">结果：0</div>

<script>
    function mufn(x) {
        // let i1 = document.getElementById("i1");
        // let i2 = document.getElementById("i2");
        // let d =document.getElementById("dd");
        switch (x) {
            case 1:
                dd.innerText = i1.value*1+i2.value*1;
                break;
            case 2:
                dd.innerText = i1.value - i2.value;
                break;
            case 3:
                dd.innerText = i1.value*i2.value;
                break;
            case 4:
                dd.innerText = i1.value/ i2.value;
                break;
        }

    }
</script>
</body>
</html>